/* TypewriterEffect component styles */

.typewriter-container {
  position: relative;
  width: 100%;
}

.typewriter-content {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  line-height: 1.6;
  color: #333;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Cursor animation */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background-color: #333;
  animation: blink 1s infinite;
  margin-left: 2px;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Control buttons */
.typewriter-controls {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.typewriter-button {
  padding: 6px 12px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.typewriter-button:hover {
  background-color: #40a9ff;
}

.typewriter-button:active {
  background-color: #096dd9;
}

/* Hide controls by default - can be shown when needed */
.typewriter-controls {
  display: none;
}

/* Show controls when container is hovered or focused */
.typewriter-container:hover .typewriter-controls,
.typewriter-container:focus-within .typewriter-controls {
  display: flex;
}

/* Markdown styles */
.typewriter-content h1,
.typewriter-content h2,
.typewriter-content h3,
.typewriter-content h4,
.typewriter-content h5,
.typewriter-content h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.typewriter-content h1 {
  font-size: 2em;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.3em;
}

.typewriter-content h2 {
  font-size: 1.5em;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 0.3em;
}

.typewriter-content h3 {
  font-size: 1.25em;
}

.typewriter-content p {
  margin-bottom: 16px;
}

.typewriter-content ul,
.typewriter-content ol {
  padding-left: 2em;
  margin-bottom: 16px;
}

.typewriter-content li {
  margin-bottom: 4px;
}

.typewriter-content code {
  padding: 2px 4px;
  margin: 0;
  font-size: 85%;
  background-color: rgba(27, 31, 35, 0.05);
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.typewriter-content pre {
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  background-color: #f6f8fa;
  border-radius: 6px;
  margin-bottom: 16px;
}

.typewriter-content pre code {
  padding: 0;
  margin: 0;
  background-color: transparent;
  border-radius: 0;
}

.typewriter-content blockquote {
  padding: 0 1em;
  color: #6a737d;
  border-left: 0.25em solid #dfe2e5;
  margin-bottom: 16px;
}

.typewriter-content table {
  display: block;
  width: 100%;
  overflow: auto;
  margin-bottom: 16px;
  border-spacing: 0;
  border-collapse: collapse;
}

.typewriter-content table th {
  font-weight: 600;
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
  background-color: #f6f8fa;
}

.typewriter-content table td {
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
}

.typewriter-content table tr:nth-child(2n) {
  background-color: #f6f8fa;
}

.typewriter-content img {
  max-width: 100%;
  height: auto;
  margin: 16px 0;
}

.typewriter-content a {
  color: #0366d6;
  text-decoration: none;
}

.typewriter-content a:hover {
  text-decoration: underline;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .typewriter-content {
    color: #c9d1d9;
  }

  .typewriter-cursor {
    background-color: #c9d1d9;
  }

  .typewriter-content code {
    background-color: rgba(110, 118, 129, 0.4);
  }

  .typewriter-content pre {
    background-color: #161b22;
  }

  .typewriter-content blockquote {
    color: #8b949e;
    border-left-color: #30363d;
  }

  .typewriter-content table th {
    background-color: #161b22;
    border-color: #30363d;
  }

  .typewriter-content table td {
    border-color: #30363d;
  }

  .typewriter-content table tr:nth-child(2n) {
    background-color: #0d1117;
  }

  .typewriter-content h1,
  .typewriter-content h2 {
    border-bottom-color: #21262d;
  }

  .typewriter-content a {
    color: #58a6ff;
  }
}